1. Jupyter Project at Bryn Mawr: Help

Welcome to the Jupyter Project at Bryn Mawr College. Jupyter is an interface to write executable documents, reproducible research, documents with visualizations, and just explore computation.

You can log into Jupyter here: http://jupyter.cs.brynmawr.edu

Below you will find some help on getting started with Jupyter at Bryn Mawr College.

1.1 Changing your password

In [1]:
from calico.password import change_password

A new password should have numbers and letters, composed of more than just dictionary words, and be of sufficient length. It may take more than one try to create a good password:

In [ ]:
change_password()

1.2 Sharing your notebooks

First, make a folder in your root directory:

In [2]:
! mkdir ~/Public

Next, make it readable by all:

In [3]:
! chmod a+r ~/Public

Finally, make the readability "sticky" so that all files created here will be readable by all:

In [ ]:
! chmod g+s ~/Public

Currently there is a bug in Jupyter: if you open and re-save your Public notebook, you'll have to reset the permissions. See issue #6405.

1.3 Copying shared notebooks

In [4]:
! mkdir ~/Incoming
In [5]:
! chmod a+w ~/Incoming

1.4 Enabling other languages

1.4.1 Enable Calico Scheme kernel

In [ ]:
! mkdir -p ~/.ipython/kernels/calico_scheme_kernel
In [ ]:
%%file ~/.ipython/kernels/calico_scheme_kernel/kernel.json

{
  "argv": ["/usr/bin/python", 
           "-m", "calico_scheme_kernel", 
           "-f", "{connection_file}"], 
  "display_name": "Scheme", 
  "language": "scheme"
}

1.4.2 Enable Python 3 kernel

In [ ]:
! mkdir -p ~/.ipython/kernels/python3
In [ ]:
%%file ~/.ipython/kernels/python3/kernel.json

{
 "display_name": "IPython (Python 3)", 
 "language": "python", 
 "argv": [
  "python3", 
  "-c", "from IPython.kernel.zmq.kernelapp import main; main()", 
  "-f", "{connection_file}"
 ], 
 "codemirror_mode": {
  "version": 2, 
  "name": "ipython"
 }
}

1.4.3 Enable Calico kernel

In [ ]:
! git clone https://bitbucket.org/ipre/calico.git ~/Calico
In [ ]:
! cp ~/Calico/bin/linux/clrzmq.dll ~/Calico/bin/ 
In [1]:
! mkdir -p ~/.ipython/kernels/calico 

Replace USER below with your user id:

In [ ]:
%%file ~/.ipython/kernels/calico/kernel.json

{
  "argv": ["/usr/bin/mono", 
           "/home/USER/Calico/bin/Calico.exe",
           "--nographics", 
           "--server", "{connection_file}"], 
  "display_name": "Calico", 
  "language": "python"
}

1.4.4 Enable Julia kernel

In [ ]:
! julia -e "Pkg.add(\"IJulia\")"

Replace USER with your user id:

In [ ]:
%%file ~/.ipython/kernels/julia/kernel.json

{
    "display_name": "Julia", 
    "language": "julia", 
    "argv": ["/usr/bin/julia-basic", 
            "-F", "/home/USER/.julia/v0.2/IJulia/src/kernel.jl", "{connection_file}"
            ]
}

1.4.5 Enable Octave (Matlab) kernel

FIXME: add details

2. Installing extensions

There are three collections of Calico notebook extensions that you might be interested in using. Below you can see demonstrations and installation instructions.

2.1 Spell Checking

The Calico Spell Check extension checks the spelling of words in Markdown and Heading cells as you type. It is very fast, and expands to about 700k after download.

Demonstration of use:

In [5]:
import IPython
In [8]:
IPython.display.YouTubeVideo("Km3AtRynWFQ")
Out[8]:
In [ ]:
!ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip

2.2 Document Tools

The Calico Document Tools extensions adds section moving, heading numbering, table of contents, and bibliography support.

Demonstration of use:

In [7]:
IPython.display.YouTubeVideo("YbM8rrj-Bms")
Out[7]:
In [1]:
!ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-document-tools-1.0.zip
downloading https://bitbucket.org/ipre/calico/downloads/calico-document-tools-1.0.zip to /tmp/tmpbji1iyly/calico-document-tools-1.0.zip
extracting /tmp/tmpbji1iyly/calico-document-tools-1.0.zip to /home/dblank/.ipython/nbextensions

2.3 Cell Tools

The Calico Cell Tools extension adds tabbed Input/Output views to individual code cells, and two columns to individual cells.

Demonstration of use:

In [11]:
IPython.display.YouTubeVideo("WwoTzvOkEJQ")
Out[11]:
In [ ]:
!ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-cell-tools-1.0.zip

2.4 Easy install of notebook extensions

You could load these in just this notebook with the following:

In [3]:
%%javascript

IPython.load_extensions('calico-spell-check', 'calico-document-tools', 'calico-cell-tools');

Or, you could add these to your custom.js file so that they will be loaded always:

In [2]:
%%file ~/.ipython/profile_default/static/custom/custom.js

require(["base/js/events"], function (events) {
    events.on("app_initialized.NotebookApp", function () {
        IPython.load_extensions('calico-spell-check', 'calico-document-tools', 'calico-cell-tools');
        // To turn off automatically creating closing parenthesis and bracket:
        IPython.CodeCell.options_default.cm_config["autoCloseBrackets"] = "";
    });
});
Overwriting /home/dblank/.ipython/profile_default/static/custom/custom.js

3. Learning about...

3.1 Notebook

Some resources for learning about how to edit Jupyter Notebooks:

  1. Jupyter Notebook Users Manual

3.2 Python

Some good resources on learning Python in notebooks:

  1. http://mbakker7.github.io/exploratory_computing_with_python/

4. Known issues

  1. You should be able to use any browser (previously one needed to use the Chrome browser); Fixed Sep 2, 2014.
  2. You can't actually log out
  3. You can't log in using https (secure connection)

comments powered by Disqus